package main

import (
	"encoding/json"
	"fmt"
	"log"
	"time"
)

type SkeMsgServerInfo struct {
	EdgeConfig Edge `yaml:"edge"`
	Time       string `yaml:"time"`
}

type Edge struct {
	Hostname      string `yaml:"hostname"`
	Mode          string `yaml:"mode"`
	ClusterRole   string `yaml:"clusterRole"`
	MgmtInterface string `yaml:"mgmtInterface"`
	CtlIpaddress  string `yaml:"ctlIpaddress"`
	MgmtIpaddress string `yaml:"mgmtIpaddress"`
	Vip           string `yaml:"vip"`
	VipInterface  string `yaml:"vipInterface"`
	ManageIP      string `yaml:"manageIP"`
	Token         string `yaml:"token"`
}

func main() {
	Edge := Edge{
		Vip: "1.2.3.4",
	}
	str := fmt.Sprintf("%s", time.Now())
	fmt.Println(str[:19])
	SkeMsgServerInfo := SkeMsgServerInfo {
		Edge,
		str[:19],
	}

	byts,err := json.Marshal(SkeMsgServerInfo)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(byts))

	return
}
